package com.example.test.a20240530;

import java.util.Scanner;

public class HJ81字符串字符匹配 {

    public static void main(String[] args) {


        Scanner in = new Scanner(System.in);

        final String letterShort = in.nextLine();
        final String letterLong = in.nextLine();

        boolean flag = true;
        for (int i = 0; i < letterShort.length(); i++) {
            if (!letterLong.contains(String.valueOf(letterShort.charAt(i)))) {
                flag = false;
                break;
            }
        }
        System.out.println(flag);
    }
}
